import * as vscode from 'vscode';
import filtUtils from './fileUtils';

class Command {
    constructor(private context: vscode.ExtensionContext){
    }
    async showProject() {
        let projects = new Set<string>();
		let data = await filtUtils.getJavaProjectsInWorkspace();
        data.forEach(d => {
            projects.add(d);
        });
		data = await filtUtils.getJavaProjectsBySearch();
        data.forEach(d => {
            projects.add(d);
        });
        let options: any[] = [];
		 projects.forEach(d=>{
            options.push({label:d, description: "暂不指定优先加载项目"});
         });
		const selectedOption = await vscode.window.showQuickPick([ {label:"", description: "暂不指定优先加载项目"}, ...options ], {
			placeHolder: '调试器搜索类名时的首选工程'
		});
		return selectedOption?.label;
	}
}

export default Command;